<!DOCTYPE html>
<html>

<head>
    <title>obj-obj</title>
</head>
<h1>基于localStroge的图片缓存技术</h1>
<body>
    <script type="text/javascript">
    var o1 = {
        a: 111,
        b: 222
    };
    var o2 = {
        c: 333
    };

    var newObj = combineObj(o1, o2);
    console.log(newObj);
    /**
     * [combineObj 合并两个对象]
     * @Author   zhanggongze
     * @DateTime 2017-06-02
     * @param    {[type]}    o1 [主对象]
     * @param    {[type]}    o2 [被合并的对象]
     * @return   {[type]}       [obj]
     */
    function combineObj(obj1, obj2) {
        var obj = {};
        for (item in obj1) {
            obj[item] = obj1[item];
        }
        for (item in obj2) {
            obj[item] = obj2[item];
        }
        return obj;
    }
    </script>
</body>

</html>
